package org.su.generalmvc.core;

import java.lang.reflect.Method;

/**
 * action代理类，代理具体的控制器的action方法（含有RequestMapping注解的方法）
 * @author yangchuan
 * @since 2012-03-6
 * @version 1.0
 */
public class ActionProxy {
	
	private ActionConfig actionConfig;
	
	/**
	 * 控制器类
	 */
	private Object controller;
	
	/**
	 * 具体控制器方法
	 */
	private Method action;
	
	public ActionConfig getActionConfig() {
		return actionConfig;
	}

	public void setActionConfig(ActionConfig actionConfig) {
		this.actionConfig = actionConfig;
	}

	public Object getController() {
		return controller;
	}

	public void setController(Object controller) {
		this.controller = controller;
	}

	public Method getAction() {
		return action;
	}

	public void setAction(Method action) {
		this.action = action;
	}

	public Object execute(Object[] args ) throws Exception {
		return  action.invoke(controller, args);
	}
	
	
	
	
}
